package com.edu.controller;

import com.edu.bean.Car;
import com.edu.bean.Person;
import com.edu.bean.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Author:何包蛋
 * @Date :2022/11/15 - 11 - 15 - 19:36
 */
@Controller
public class MyController {

    @RequestMapping("/login")
    public ModelAndView login(String username , String password){
        System.out.println(username+":"+password);
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("success.jsp");
        modelAndView.addObject("msg",username);
        return modelAndView;
    }
    @RequestMapping("/regiest")
    public String regiest(User user){
        System.out.println(user.toString());
        for (Car car : user.getCars()) {
            System.out.println(car);
        }
        return "success.jsp";
    }




}
